Configure NIS Client
2013/07/04 |
Configure on NIS clients in order to share users' accounts in your local networks. |
[root@www ~]#
[root@www ~]# yum -y install ypbind rpcbind ypdomainname srv.world # set NIS domain name
[root@www ~]#
vi /etc/sysconfig/authconfig
USENIS=
yes # line 22: change
[root@www ~]#
vi /etc/yp.conf # add at the last line ( [domain] server [NIS server] ) domain srv.world server dlp.srv.world
[root@www ~]#
vi /etc/nsswitch.conf
passwd:
nis files# line 33: add shadow: nis files# add group: nis files# add hosts: nis files dns myhostname # add # add optionally if you need ( create home directory automatically if it's none ) [root@www ~]# vi /etc/pam.d/system-auth # add at the last line session optional pam_mkhomedir.so skel=/etc/skel umask=077 systemctl enable rpcbind.service [root@www ~]# systemctl enable ypbind.service
[root@www ~]#
www login: fedora # a user on NIS Password: # NIS password Creating directory '/home/fedora'. [fedora@www ~]$ # logined [fedora@www ~]$ dlp.srv.world [fedora@www ~]$ ypcat passwd fedora:x:1000:1000:fedora:/home/fedora:/bin/bash hiroyuki:x:1001:1001::/home/hiroyuki:/bin/bash polkitd:x:999:999:User for polkitd:/:/sbin/nologin saslauth:x:998:76:"Saslauthd user":/run/saslauthd:/sbin/nologin [fedora@www ~]$ ypcat hosts 10.0.0.30 dlp.srv.world dlp 10.0.0.30 dlp.srv.world dlp 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 |